﻿using System.Collections.Generic;
using Microsoft.Xna.Framework.Graphics;

namespace LoA.Shared {
	public static class Config {
		private static Dictionary<string, string> Setting;

		public static void Initialize( ) {
			Setting = new Dictionary<string, string>( );

			Setting.Add("GameContentDir", "Data");

			Setting.Add("GraphicResolution", "");
			Setting.Add("GraphicGamma", "");
			Setting.Add("GraphicFullscrean", "");
			Setting.Add("GraphicMultisampling", "");

			Setting.Add("SoundMusicVolume", "");
			Setting.Add("SoundSoundsVolume", "");
			Setting.Add("SoundVoicesVolume", "");
			Setting.Add("SoundNatureSoundsVolume", "");
			Setting.Add("SoundBackgroundSoundsVolume", "");
		}


		//public static float Pitch { get; set; }
		//public static float Pan { get; set; }
		//public static float Volume { get; set; }
		//public static bool IsLooped { get; set; }
		//public static bool Is3D { get; set; }

		public static string Get(string key) {
			if (Setting == null)
				Initialize( );
			if (Setting.ContainsKey(key))
				return Setting[key];
			else
				return "";
		}

		public static void Set(string key, string value) {
			if (Setting == null)
				Initialize( );
			if (Setting.ContainsKey(key))
				Setting[key] = value;
			else
				Setting.Add(key, value);
		}
	}

	public static class Definitions {
		public static Resolution[ ] Resolutions = new Resolution[ ] {
			new Resolution { Weight = 854, Height = 480, Text="WVGA 854 x 480 (18:10)" },

			new Resolution { Weight = 320, Height = 240, Text="QVGA 320 x 240 (4:3)" },
			new Resolution { Weight = 640, Height = 480, Text="VGA 640 x 480 (4:3)" },
			new Resolution { Weight = 800, Height = 600, Text="SVGA  800 x 600 (4:3)" },
			new Resolution { Weight = 1024, Height = 768, Text="XGA 1024 x 768 (4:3)" },
			new Resolution { Weight = 1280, Height = 1024, Text="SXGA 1280 x 1024 (5:4)" },
			new Resolution { Weight = 1400, Height = 1050, Text="SXGA+ 1400 x 1050 (4:3)" },
			new Resolution { Weight = 1600, Height = 1200, Text="UXGA 1600 x 1200 (4:3)" },
			new Resolution { Weight = 2048, Height = 1536, Text="QXGA 2048 x 1536 (4:3)" },
			new Resolution { Weight = 2560, Height = 2048, Text="QSXGA 2560 x 2048 (5:4)" },
			
			new Resolution { Weight = 1024, Height = 600, Text="WSVGA 1024 x 600 (16:9)" },
			new Resolution { Weight = 1280, Height = 720, Text="HDTV 720p 1280 x 720 (16:9)" },
			new Resolution { Weight = 1366, Height = 768, Text="HDTV 1366 x 768 (16:9)" },
			new Resolution { Weight = 1920, Height = 1080, Text="HDTV 1080p 1920 x 1080 (16:9)" },
			new Resolution { Weight = 2048, Height = 1152, Text="QWXGA 2048 x 1152 (16:9)" },

			new Resolution { Weight = 1280, Height = 800, Text="WXGA 1280 x 800 (16:10)" },
			new Resolution { Weight = 1440, Height = 900, Text="WXGA+ 1440 x 900 (16:10)" },
			new Resolution { Weight = 1600, Height = 1024, Text="WSXGA 1600 x 1024 (16:10)" },
			new Resolution { Weight = 1680, Height = 1050, Text="WSXGA+ 1680 x 1050 (16:10)" },
			new Resolution { Weight = 1920, Height = 1200, Text="WUXGA 1920 x 1200 (16:10)" },
			new Resolution { Weight = 2560, Height = 1600, Text="WQXGA 2560 x 1600 (16:10)" }
		};
	}

	public struct Resolution {
		public int Weight;
		public int Height;
		public string Text;
	}
}